import { ref, } from 'vue'
import { defineStore } from 'pinia'

export const useLoginStore = defineStore('login', () => {
  const hasLogin = ref(false)
  function setLogin(val) {
    hasLogin.value = val
  }
  function logout() {
    sessionStorage.setItem('loginToken', '')
    sessionStorage.setItem('userInfo', '')
    hasLogin.value = false
  }
  return { hasLogin, setLogin, logout }
})
